<?php
use Sow\bug as Y;
use Sow\mysql\Instance as mysql;
use Sow\redis\Instance as redis;


class db {

    //----------------Mysql--------------------
    public static function testdb(){
        return mysql::db("testdb");
    }

    //----------------Redis--------------------
    public static function ad(){
    	return redis::db("ad");
    }
    
}

/***
*model层使用方法
*
*1.  use \db; 
*有朋友可能要问,为什么这里写的这么简洁,而不是全路径.
因为在ini文件中有如下定义.
application.library = SYSPATH"/library"
application.library.directory   = SYSPATH"/library"   
*
*
在model类的某个function里可以这样写:

*public static function FindData($type){
        //获取数据库链接
        $mysql = mysql::db("testdb");
        $select_sql = "SELECT `data` FROM tablename WHERE type = $type ;";
        $mysql->query("$select_sql");
        $rel = $mysql->fetch();
        return $data;
}

******/
